/**
 * Created by huzhihui on 2017/9/19.
 */
import React from "react";
import {connect} from "dva";
import "./index.css";

class Configuration extends React.Component {

    componentDidMount() {
        this.getHtml();
    }

    getHtml() {
        const {dispatch} = this.props;
        dispatch({
            type: 'api/updateDefaultSelectedKeys',
            payload: ['2'],
        });
        ;
        dispatch({
            type: 'configuration/getConfigurationHtml'
        });
    }

    render() {
        const {configurationHtml} = this.props;
        return (
            <div>
                <div dangerouslySetInnerHTML={{__html: configurationHtml}}/>
            </div>
        )

    }
}

export default connect(({configuration: {configurationHtml}}) => ({
    configurationHtml
}))(Configuration);